/**
*  @class FileSystemWin32
*
*  @brief
*
*  @author William McVicar
*/

#pragma once

#ifndef __FILE_SYSTEM_WIN_32_H_INCLUDED__
#define __FILE_SYSTEM_WIN_32_H_INCLUDED__

#ifdef PROTEIN_PLATFORM_WINDOWS
//  Library Includes

//  Local Includes
#include "IFileSystem.h"

//  Macros

//  Forward Declarations

//  Types

//  Constants

//  Prototypes

namespace Protein
{

class FileSystemWin32 : public IFileSystem
{
	friend class ProteinFramework;
   //Member Functions
public:

	virtual eFILESYSTEM_ERROR FileExists( const c8* _szFilename, char* _pBuffer, const Directory& _krDirectory = sm_WorkingDirectory, bool _bRecursive = true ) const;

	virtual bool Open( const c8* _szFilename, const c8* _szFileMode, FILE** _ppFile, bool _bAbsolutePath = false );
	virtual bool Close( FILE* _pFile );
	virtual i32 Read( u8* _pBuffer, u32 _uiSize, u32 _uiCount, FILE* _pFile );
	virtual i32 Write( u8* _pBuffer, u32 _uiSize, u32 _uiCount, FILE* _pFile );
	virtual bool Seek( FILE* _pFile, u32 _uiOffset, eSEEK_ORIGIN _eOrigin );
	virtual u32 GetOffset( FILE* _pFile );
	virtual void Rewind( FILE* _pFile ); 
	virtual i32 ReadFormattedString( FILE* _pFile, const c8* _szFormat, ... );
	virtual i32 WriteFormattedString( FILE* _pFile, const c8* _szFormat, ... );
	virtual bool ReadLine( c8* _pBuffer, FILE* _pFile );
	virtual bool ReadChunk( c8* _pBuffer, FILE* _pFile, i32 _iNum );
	virtual bool WriteString( const c8* _szBuffer, FILE* _pFile );
	virtual i32 GetFileSize( FILE* _pFile );

	// create the singleton's instance
	static void CreateInstance();
	static void CreateInstance(const char* _workingDirectory);

protected: 

   FileSystemWin32();
   FileSystemWin32(const char* _workingDirectory);
   virtual ~FileSystemWin32();

private: 

   //Member Variables
public:

protected: 

private: 

};

}

#endif //PROTEIN_PLATFORM_WINDOWS
#endif //__FILE_SYSTEM_WIN_32_H_INCLUDED__
